<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE PolyKinds #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  Data.Fixed</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) Ashley Yakeley 2005, 2006, 2009</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  Ashley Yakeley &lt;ashley@semantic.org&gt;</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- This module defines a \&quot;Fixed\&quot; type for fixed-precision arithmetic.</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- The parameter to 'Fixed' is any type that's an instance of 'HasResolution'.</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- 'HasResolution' has a single method that gives the resolution of the 'Fixed'</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- type.</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- This module also contains generalisations of 'div', 'mod', and 'divMod' to</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- work with any 'Real' instance.</span><span>
</span><span id="line-23"></span><span class="hs-comment">--</span><span>
</span><span id="line-24"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Fixed</span><span>
</span><span id="line-27"></span><span class="hs-special">(</span><span>
</span><span id="line-28"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#div%27"><span class="hs-identifier">div'</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#mod%27"><span class="hs-identifier">mod'</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#divMod%27"><span class="hs-identifier">divMod'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier">Fixed</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier">HasResolution</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#showFixed"><span class="hs-identifier">showFixed</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E0"><span class="hs-identifier">E0</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Uni"><span class="hs-identifier">Uni</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E1"><span class="hs-identifier">E1</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Deci"><span class="hs-identifier">Deci</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E2"><span class="hs-identifier">E2</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Centi"><span class="hs-identifier">Centi</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E3"><span class="hs-identifier">E3</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Milli"><span class="hs-identifier">Milli</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E6"><span class="hs-identifier">E6</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Micro"><span class="hs-identifier">Micro</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E9"><span class="hs-identifier">E9</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Nano"><span class="hs-identifier">Nano</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><a href="Data.Fixed.html#E12"><span class="hs-identifier">E12</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Fixed.html#Pico"><span class="hs-identifier">Pico</span></a></span><span>
</span><span id="line-39"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Data.html"><span class="hs-identifier">Data.Data</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.TypeLits.html"><span class="hs-identifier">GHC.TypeLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.TypeNats.html#KnownNat"><span class="hs-identifier">KnownNat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.TypeLits.html#natVal"><span class="hs-identifier">natVal</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Read.html"><span class="hs-identifier">GHC.Read</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html"><span class="hs-identifier">Text.ParserCombinators.ReadPrec</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Read.Lex.html"><span class="hs-identifier">Text.Read.Lex</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-keyword">default</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- avoid any defaulting shenanigans</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-comment">-- | Generalisation of 'div' to any instance of 'Real'</span><span>
</span><span id="line-50"></span><span id="local-6989586621679584210"><span id="local-6989586621679584211"><span class="annot"><a href="Data.Fixed.html#div%27"><span class="hs-identifier hs-type">div'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Real.html#Real"><span class="hs-identifier hs-type">Real</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584211"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Real.html#Integral"><span class="hs-identifier hs-type">Integral</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584210"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584211"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584211"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584210"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-51"></span><span id="div%27"><span class="annot"><span class="annottext">div' :: forall a b. (Real a, Integral b) =&gt; a -&gt; a -&gt; b
</span><a href="Data.Fixed.html#div%27"><span class="hs-identifier hs-var hs-var">div'</span></a></span></span><span> </span><span id="local-6989586621679583966"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583966"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679583965"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583965"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; b
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#floor"><span class="hs-identifier hs-var">floor</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583966"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Rational -&gt; Rational
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583965"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-comment">-- | Generalisation of 'divMod' to any instance of 'Real'</span><span>
</span><span id="line-54"></span><span id="local-6989586621679584200"><span id="local-6989586621679584201"><span class="annot"><a href="Data.Fixed.html#divMod%27"><span class="hs-identifier hs-type">divMod'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Real.html#Real"><span class="hs-identifier hs-type">Real</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584201"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Real.html#Integral"><span class="hs-identifier hs-type">Integral</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584200"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584201"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584201"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679584200"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679584201"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-55"></span><span id="divMod%27"><span class="annot"><span class="annottext">divMod' :: forall a b. (Real a, Integral b) =&gt; a -&gt; a -&gt; (b, a)
</span><a href="Data.Fixed.html#divMod%27"><span class="hs-identifier hs-var hs-var">divMod'</span></a></span></span><span> </span><span id="local-6989586621679583954"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583954"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679583953"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583953"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679583952"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583954"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679583952"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583953"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-56"></span><span>    </span><span id="local-6989586621679583952"><span class="annot"><span class="annottext">f :: b
</span><a href="#local-6989586621679583952"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; b
forall a b. (Real a, Integral b) =&gt; a -&gt; a -&gt; b
</span><a href="Data.Fixed.html#div%27"><span class="hs-identifier hs-var">div'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583954"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583953"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="hs-comment">-- | Generalisation of 'mod' to any instance of 'Real'</span><span>
</span><span id="line-59"></span><span id="local-6989586621679584194"><span class="annot"><a href="Data.Fixed.html#mod%27"><span class="hs-identifier hs-type">mod'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Real.html#Real"><span class="hs-identifier hs-type">Real</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584194"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584194"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584194"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584194"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-60"></span><span id="mod%27"><span class="annot"><span class="annottext">mod' :: forall a. Real a =&gt; a -&gt; a -&gt; a
</span><a href="Data.Fixed.html#mod%27"><span class="hs-identifier hs-var hs-var">mod'</span></a></span></span><span> </span><span id="local-6989586621679583943"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583943"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679583942"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583942"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583943"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583941"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583942"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621679583941"><span class="annot"><span class="annottext">f :: Integer
</span><a href="#local-6989586621679583941"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Integer
forall a b. (Real a, Integral b) =&gt; a -&gt; a -&gt; b
</span><a href="Data.Fixed.html#div%27"><span class="hs-identifier hs-var">div'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583943"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583942"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-comment">-- | The type parameter should be an instance of 'HasResolution'.</span><span>
</span><span id="line-64"></span><span class="hs-keyword">newtype</span><span> </span><span id="Fixed"><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-var">Fixed</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679584189"><span id="local-6989586621679584188"><span class="annot"><a href="#local-6989586621679584188"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679584189"><span class="hs-identifier hs-type">k</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span id="MkFixed"><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span>
</span><span id="line-65"></span><span>        </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679583932"><span id="local-6989586621679583936"><span class="annot"><span class="annottext">Fixed a -&gt; Fixed a -&gt; Bool
(Fixed a -&gt; Fixed a -&gt; Bool)
-&gt; (Fixed a -&gt; Fixed a -&gt; Bool) -&gt; Eq (Fixed a)
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
/= :: Fixed a -&gt; Fixed a -&gt; Bool
$c/= :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
== :: Fixed a -&gt; Fixed a -&gt; Bool
$c== :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span>  </span><span class="hs-comment">-- ^ @since 2.01</span><span>
</span><span id="line-66"></span><span>                 </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679583899"><span id="local-6989586621679583903"><span id="local-6989586621679583907"><span id="local-6989586621679583911"><span id="local-6989586621679583915"><span id="local-6989586621679583919"><span id="local-6989586621679583924"><span class="annot"><span class="annottext">Eq (Fixed a)
Eq (Fixed a)
-&gt; (Fixed a -&gt; Fixed a -&gt; Ordering)
-&gt; (Fixed a -&gt; Fixed a -&gt; Bool)
-&gt; (Fixed a -&gt; Fixed a -&gt; Bool)
-&gt; (Fixed a -&gt; Fixed a -&gt; Bool)
-&gt; (Fixed a -&gt; Fixed a -&gt; Bool)
-&gt; (Fixed a -&gt; Fixed a -&gt; Fixed a)
-&gt; (Fixed a -&gt; Fixed a -&gt; Fixed a)
-&gt; Ord (Fixed a)
Fixed a -&gt; Fixed a -&gt; Bool
Fixed a -&gt; Fixed a -&gt; Ordering
Fixed a -&gt; Fixed a -&gt; Fixed a
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
forall k (a :: k). Eq (Fixed a)
forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Ordering
forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Fixed a
min :: Fixed a -&gt; Fixed a -&gt; Fixed a
$cmin :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Fixed a
max :: Fixed a -&gt; Fixed a -&gt; Fixed a
$cmax :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Fixed a
&gt;= :: Fixed a -&gt; Fixed a -&gt; Bool
$c&gt;= :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
&gt; :: Fixed a -&gt; Fixed a -&gt; Bool
$c&gt; :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
&lt;= :: Fixed a -&gt; Fixed a -&gt; Bool
$c&lt;= :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
&lt; :: Fixed a -&gt; Fixed a -&gt; Bool
$c&lt; :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Bool
compare :: Fixed a -&gt; Fixed a -&gt; Ordering
$ccompare :: forall k (a :: k). Fixed a -&gt; Fixed a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></a></span></span></span></span></span></span></span></span><span> </span><span class="hs-comment">-- ^ @since 2.01</span><span>
</span><span id="line-67"></span><span>                 </span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-comment">-- We do this because the automatically derived Data instance requires (Data a) context.</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- Our manual instance has the more general (Typeable a) context.</span><span>
</span><span id="line-71"></span><span class="annot"><a href="Data.Fixed.html#tyFixed"><span class="hs-identifier hs-type">tyFixed</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Data.html#DataType"><span class="hs-identifier hs-type">DataType</span></a></span><span>
</span><span id="line-72"></span><span id="tyFixed"><span class="annot"><span class="annottext">tyFixed :: DataType
</span><a href="Data.Fixed.html#tyFixed"><span class="hs-identifier hs-var hs-var">tyFixed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Constr] -&gt; DataType
</span><a href="Data.Data.html#mkDataType"><span class="hs-identifier hs-var">mkDataType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Fixed.Fixed&quot;</span></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Constr
</span><a href="Data.Fixed.html#conMkFixed"><span class="hs-identifier hs-var">conMkFixed</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-73"></span><span class="annot"><a href="Data.Fixed.html#conMkFixed"><span class="hs-identifier hs-type">conMkFixed</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Data.html#Constr"><span class="hs-identifier hs-type">Constr</span></a></span><span>
</span><span id="line-74"></span><span id="conMkFixed"><span class="annot"><span class="annottext">conMkFixed :: Constr
</span><a href="Data.Fixed.html#conMkFixed"><span class="hs-identifier hs-var hs-var">conMkFixed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataType -&gt; String -&gt; [String] -&gt; Fixity -&gt; Constr
</span><a href="Data.Data.html#mkConstr"><span class="hs-identifier hs-var">mkConstr</span></a></span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="Data.Fixed.html#tyFixed"><span class="hs-identifier hs-var">tyFixed</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;MkFixed&quot;</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="Data.Data.html#Prefix"><span class="hs-identifier hs-var">Prefix</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-77"></span><span id="local-6989586621679584148"><span id="local-6989586621679584149"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679583863"><span id="local-6989586621679583865"><span id="local-6989586621679583867"><span id="local-6989586621679583869"><span id="local-6989586621679583871"><span id="local-6989586621679583873"><span id="local-6989586621679583875"><span id="local-6989586621679583877"><span id="local-6989586621679583879"><span id="local-6989586621679583881"><span class="hs-special">(</span><span class="annot"><a href="Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584149"><span class="hs-identifier hs-type">k</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584148"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Data.html#Data"><span class="hs-identifier hs-type">Data</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679584148"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679584149"><span class="hs-identifier hs-type">k</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-78"></span><span>    </span><span id="local-6989586621679583859"><span class="annot"><span class="annottext">gfoldl :: forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; Fixed a -&gt; c (Fixed a)
</span><a href="Data.Data.html#gfoldl"><span class="hs-identifier hs-var hs-var hs-var hs-var">gfoldl</span></a></span></span><span> </span><span id="local-6989586621679583857"><span class="annot"><span class="annottext">forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b
</span><a href="#local-6989586621679583857"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679583856"><span class="annot"><span class="annottext">forall g. g -&gt; c g
</span><a href="#local-6989586621679583856"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583855"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583855"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">c (Integer -&gt; Fixed a) -&gt; Integer -&gt; c (Fixed a)
forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b
</span><a href="#local-6989586621679583857"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; c (Integer -&gt; Fixed a)
forall g. g -&gt; c g
</span><a href="#local-6989586621679583856"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583855"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span id="local-6989586621679583853"><span class="annot"><span class="annottext">gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c (Fixed a)
</span><a href="Data.Data.html#gunfold"><span class="hs-identifier hs-var hs-var hs-var hs-var">gunfold</span></a></span></span><span> </span><span id="local-6989586621679583851"><span class="annot"><span class="annottext">forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><a href="#local-6989586621679583851"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679583850"><span class="annot"><span class="annottext">forall r. r -&gt; c r
</span><a href="#local-6989586621679583850"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="annot"><span class="annottext">Constr
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">c (Integer -&gt; Fixed a) -&gt; c (Fixed a)
forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><a href="#local-6989586621679583851"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; c (Integer -&gt; Fixed a)
forall r. r -&gt; c r
</span><a href="#local-6989586621679583850"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>    </span><span id="local-6989586621679583849"><span class="annot"><span class="annottext">dataTypeOf :: Fixed a -&gt; DataType
</span><a href="Data.Data.html#dataTypeOf"><span class="hs-identifier hs-var hs-var hs-var hs-var">dataTypeOf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="Data.Fixed.html#tyFixed"><span class="hs-identifier hs-var">tyFixed</span></a></span><span>
</span><span id="line-81"></span><span>    </span><span id="local-6989586621679583847"><span class="annot"><span class="annottext">toConstr :: Fixed a -&gt; Constr
</span><a href="Data.Data.html#toConstr"><span class="hs-identifier hs-var hs-var hs-var hs-var">toConstr</span></a></span></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Constr
</span><a href="Data.Fixed.html#conMkFixed"><span class="hs-identifier hs-var">conMkFixed</span></a></span></span></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-keyword">class</span><span> </span><span id="HasResolution"><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-var">HasResolution</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679584143"><span id="local-6989586621679584142"><span class="annot"><a href="#local-6989586621679584142"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679584143"><span class="hs-identifier hs-type">k</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-84"></span><span>    </span><span id="local-6989586621679584145"><span id="resolution"><span class="annot"><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-type">resolution</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679584145"><span class="hs-identifier hs-type">p</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584142"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span></span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="hs-comment">-- | For example, @Fixed 1000@ will give you a 'Fixed' with a resolution of 1000.</span><span>
</span><span id="line-87"></span><span id="local-6989586621679584141"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.TypeNats.html#KnownNat"><span class="hs-identifier hs-type">KnownNat</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584141"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584141"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-88"></span><span>    </span><span id="local-6989586621679583839"><span class="annot"><span class="annottext">resolution :: forall (p :: Nat -&gt; *). p n -&gt; Integer
</span><a href="#local-6989586621679583839"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p n
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy n -&gt; Integer
forall (n :: Nat) (proxy :: Nat -&gt; *).
KnownNat n =&gt;
proxy n -&gt; Integer
</span><a href="GHC.TypeLits.html#natVal"><span class="hs-identifier hs-var">natVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy n
forall {k} (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584141"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span id="local-6989586621679584132"><span id="local-6989586621679584133"><span class="annot"><a href="Data.Fixed.html#withType"><span class="hs-identifier hs-type">withType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584133"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584132"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584133"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584132"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584133"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-91"></span><span id="withType"><span class="annot"><span class="annottext">withType :: forall {k} (a :: k) (f :: k -&gt; *). (Proxy a -&gt; f a) -&gt; f a
</span><a href="Data.Fixed.html#withType"><span class="hs-identifier hs-var hs-var">withType</span></a></span></span><span> </span><span id="local-6989586621679583836"><span class="annot"><span class="annottext">Proxy a -&gt; f a
</span><a href="#local-6989586621679583836"><span class="hs-identifier hs-var">foo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy a -&gt; f a
</span><a href="#local-6989586621679583836"><span class="hs-identifier hs-var">foo</span></a></span><span> </span><span class="annot"><span class="annottext">Proxy a
forall {k} (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span id="local-6989586621679584126"><span id="local-6989586621679584127"><span class="annot"><a href="Data.Fixed.html#withResolution"><span class="hs-identifier hs-type">withResolution</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584127"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584126"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584127"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679584126"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584127"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-94"></span><span id="withResolution"><span class="annot"><span class="annottext">withResolution :: forall {k} (a :: k) (f :: k -&gt; *).
HasResolution a =&gt;
(Integer -&gt; f a) -&gt; f a
</span><a href="Data.Fixed.html#withResolution"><span class="hs-identifier hs-var hs-var">withResolution</span></a></span></span><span> </span><span id="local-6989586621679583832"><span class="annot"><span class="annottext">Integer -&gt; f a
</span><a href="#local-6989586621679583832"><span class="hs-identifier hs-var">foo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Proxy a -&gt; f a) -&gt; f a
forall {k} (a :: k) (f :: k -&gt; *). (Proxy a -&gt; f a) -&gt; f a
</span><a href="Data.Fixed.html#withType"><span class="hs-identifier hs-var">withType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; f a
</span><a href="#local-6989586621679583832"><span class="hs-identifier hs-var">foo</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; f a) -&gt; (Proxy a -&gt; Integer) -&gt; Proxy a -&gt; f a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Proxy a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-97"></span><span class="hs-comment">--</span><span>
</span><span id="line-98"></span><span class="hs-comment">-- Recall that, for numeric types, 'succ' and 'pred' typically add and subtract</span><span>
</span><span id="line-99"></span><span class="hs-comment">-- @1@, respectively. This is not true in the case of 'Fixed', whose successor</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- and predecessor functions intuitively return the &quot;next&quot; and &quot;previous&quot; values</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- in the enumeration. The results of these functions thus depend on the</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- resolution of the 'Fixed' value. For example, when enumerating values of</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- resolution @10^-3@ of @type Milli = Fixed E3@,</span><span>
</span><span id="line-104"></span><span class="hs-comment">--</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-106"></span><span class="hs-comment">--   succ (0.000 :: Milli) == 1.001</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-108"></span><span class="hs-comment">--</span><span>
</span><span id="line-109"></span><span class="hs-comment">--</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- and likewise</span><span>
</span><span id="line-111"></span><span class="hs-comment">--</span><span>
</span><span id="line-112"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-113"></span><span class="hs-comment">--   pred (0.000 :: Milli) == -0.001</span><span>
</span><span id="line-114"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-115"></span><span class="hs-comment">--</span><span>
</span><span id="line-116"></span><span class="hs-comment">--</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- In other words, 'succ' and 'pred' increment and decrement a fixed-precision</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- value by the least amount such that the value's resolution is unchanged.</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- For example, @10^-12@ is the smallest (positive) amount that can be added to</span><span>
</span><span id="line-120"></span><span class="hs-comment">-- a value of @type Pico = Fixed E12@ without changing its resolution, and so</span><span>
</span><span id="line-121"></span><span class="hs-comment">--</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-123"></span><span class="hs-comment">--   succ (0.000000000000 :: Pico) == 0.000000000001</span><span>
</span><span id="line-124"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-125"></span><span class="hs-comment">--</span><span>
</span><span id="line-126"></span><span class="hs-comment">--</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- and similarly</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-130"></span><span class="hs-comment">--   pred (0.000000000000 :: Pico) == -0.000000000001</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-132"></span><span class="hs-comment">--</span><span>
</span><span id="line-133"></span><span class="hs-comment">--</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- This is worth bearing in mind when defining 'Fixed' arithmetic sequences. In</span><span>
</span><span id="line-135"></span><span class="hs-comment">-- particular, you may be forgiven for thinking the sequence</span><span>
</span><span id="line-136"></span><span class="hs-comment">--</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-138"></span><span class="hs-comment">--   [1..10] :: [Pico]</span><span>
</span><span id="line-139"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-140"></span><span class="hs-comment">--</span><span>
</span><span id="line-141"></span><span class="hs-comment">--</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- evaluates to @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] :: [Pico]@.</span><span>
</span><span id="line-143"></span><span class="hs-comment">--</span><span>
</span><span id="line-144"></span><span class="hs-comment">-- However, this is not true. On the contrary, similarly to the above</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- implementations of 'succ' and 'pred', @enumFromTo :: Pico -&gt; Pico -&gt; [Pico]@</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- has a &quot;step size&quot; of @10^-12@. Hence, the list @[1..10] :: [Pico]@ has</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- the form</span><span>
</span><span id="line-148"></span><span class="hs-comment">--</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-150"></span><span class="hs-comment">--   [1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000]</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-152"></span><span class="hs-comment">--</span><span>
</span><span id="line-153"></span><span class="hs-comment">--</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- and contains @9 * 10^12 + 1@ values.</span><span>
</span><span id="line-155"></span><span id="local-6989586621679584115"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Enum.html#Enum"><span class="hs-identifier hs-type">Enum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584115"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-156"></span><span>    </span><span id="local-6989586621679583818"><span class="annot"><span class="annottext">succ :: Fixed a -&gt; Fixed a
</span><a href="GHC.Enum.html#succ"><span class="hs-identifier hs-var hs-var hs-var hs-var">succ</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583816"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583816"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Enum a =&gt; a -&gt; a
</span><a href="GHC.Enum.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583816"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>    </span><span id="local-6989586621679583814"><span class="annot"><span class="annottext">pred :: Fixed a -&gt; Fixed a
</span><a href="GHC.Enum.html#pred"><span class="hs-identifier hs-var hs-var hs-var hs-var">pred</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583812"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583812"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Enum a =&gt; a -&gt; a
</span><a href="GHC.Enum.html#pred"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583812"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>    </span><span id="local-6989586621679583810"><span class="annot"><span class="annottext">toEnum :: Int -&gt; Fixed a
</span><a href="GHC.Enum.html#toEnum"><span class="hs-identifier hs-var hs-var hs-var hs-var">toEnum</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; (Int -&gt; Integer) -&gt; Int -&gt; Fixed a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Enum a =&gt; Int -&gt; a
</span><a href="GHC.Enum.html#toEnum"><span class="hs-identifier hs-var">toEnum</span></a></span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621679583807"><span class="annot"><span class="annottext">fromEnum :: Fixed a -&gt; Int
</span><a href="GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromEnum</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583805"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583805"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int
forall a. Enum a =&gt; a -&gt; Int
</span><a href="GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var">fromEnum</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583805"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-160"></span><span>    </span><span id="local-6989586621679583801"><span class="annot"><span class="annottext">enumFrom :: Fixed a -&gt; [Fixed a]
</span><a href="GHC.Enum.html#enumFrom"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFrom</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583800"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583800"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; [Integer] -&gt; [Fixed a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; [Integer]
forall a. Enum a =&gt; a -&gt; [a]
</span><a href="GHC.Enum.html#enumFrom"><span class="hs-identifier hs-var">enumFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583800"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span>    </span><span id="local-6989586621679583797"><span class="annot"><span class="annottext">enumFromThen :: Fixed a -&gt; Fixed a -&gt; [Fixed a]
</span><a href="GHC.Enum.html#enumFromThen"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFromThen</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583796"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583796"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583795"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583795"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; [Integer] -&gt; [Fixed a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; [Integer]
forall a. Enum a =&gt; a -&gt; a -&gt; [a]
</span><a href="GHC.Enum.html#enumFromThen"><span class="hs-identifier hs-var">enumFromThen</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583796"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583795"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>    </span><span id="local-6989586621679583792"><span class="annot"><span class="annottext">enumFromTo :: Fixed a -&gt; Fixed a -&gt; [Fixed a]
</span><a href="GHC.Enum.html#enumFromTo"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFromTo</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583791"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583791"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583790"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583790"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; [Integer] -&gt; [Fixed a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; [Integer]
forall a. Enum a =&gt; a -&gt; a -&gt; [a]
</span><a href="GHC.Enum.html#enumFromTo"><span class="hs-identifier hs-var">enumFromTo</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583791"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583790"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>    </span><span id="local-6989586621679583787"><span class="annot"><span class="annottext">enumFromThenTo :: Fixed a -&gt; Fixed a -&gt; Fixed a -&gt; [Fixed a]
</span><a href="GHC.Enum.html#enumFromThenTo"><span class="hs-identifier hs-var hs-var hs-var hs-var">enumFromThenTo</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583786"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583786"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583785"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583785"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583784"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583784"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; [Integer] -&gt; [Fixed a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer -&gt; [Integer]
forall a. Enum a =&gt; a -&gt; a -&gt; a -&gt; [a]
</span><a href="GHC.Enum.html#enumFromThenTo"><span class="hs-identifier hs-var">enumFromThenTo</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583786"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583785"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583784"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-166"></span><span id="local-6989586621679584108"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584108"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584108"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-167"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583772"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583772"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679583771"><span class="annot"><span class="annottext">+ :: Fixed a -&gt; Fixed a -&gt; Fixed a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var hs-var hs-var hs-var">+</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583769"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583769"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583772"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583769"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583767"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583767"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679583766"><span class="annot"><span class="annottext">- :: Fixed a -&gt; Fixed a -&gt; Fixed a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var hs-var hs-var hs-var">-</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583765"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583765"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583767"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583765"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>    </span><span id="local-6989586621679583761"><span class="annot"><span class="annottext">fa :: Fixed a
</span><a href="#local-6989586621679583761"><span class="hs-identifier hs-var">fa</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583760"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583760"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679583759"><span class="annot"><span class="annottext">* :: Fixed a -&gt; Fixed a -&gt; Fixed a
</span><a href="#local-6989586621679583759"><span class="hs-operator hs-var hs-var hs-var hs-var">*</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583758"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583758"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583760"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583758"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583761"><span class="hs-identifier hs-var">fa</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>    </span><span id="local-6989586621679583755"><span class="annot"><span class="annottext">negate :: Fixed a -&gt; Fixed a
</span><a href="GHC.Num.html#negate"><span class="hs-identifier hs-var hs-var hs-var hs-var">negate</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583754"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583754"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a
</span><a href="GHC.Num.html#negate"><span class="hs-identifier hs-var">negate</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583754"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>    </span><span id="local-6989586621679583752"><span class="annot"><span class="annottext">abs :: Fixed a -&gt; Fixed a
</span><a href="GHC.Num.html#abs"><span class="hs-identifier hs-var hs-var hs-var hs-var">abs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583750"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583750"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a
</span><a href="GHC.Num.html#abs"><span class="hs-identifier hs-var">abs</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583750"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621679583747"><span class="annot"><span class="annottext">signum :: Fixed a -&gt; Fixed a
</span><a href="GHC.Num.html#signum"><span class="hs-identifier hs-var hs-var hs-var hs-var">signum</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583745"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583745"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a
</span><a href="GHC.Num.html#signum"><span class="hs-identifier hs-var">signum</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583745"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span>    </span><span id="local-6989586621679583742"><span class="annot"><span class="annottext">fromInteger :: Integer -&gt; Fixed a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromInteger</span></a></span></span><span> </span><span id="local-6989586621679583741"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583741"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; Fixed a
forall {k} (a :: k) (f :: k -&gt; *).
HasResolution a =&gt;
(Integer -&gt; f a) -&gt; f a
</span><a href="Data.Fixed.html#withResolution"><span class="hs-identifier hs-var">withResolution</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679583740"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583740"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583741"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583740"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-176"></span><span id="local-6989586621679584103"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584103"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Real.html#Real"><span class="hs-identifier hs-type">Real</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584103"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-177"></span><span>    </span><span id="local-6989586621679583726"><span class="annot"><span class="annottext">toRational :: Fixed a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var hs-var hs-var hs-var">toRational</span></a></span></span><span> </span><span id="local-6989586621679583725"><span class="annot"><span class="annottext">fa :: Fixed a
</span><a href="#local-6989586621679583725"><span class="hs-identifier hs-var">fa</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583724"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583724"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583724"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Rational -&gt; Rational
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583725"><span class="hs-identifier hs-var">fa</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-180"></span><span id="local-6989586621679584099"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584099"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Real.html#Fractional"><span class="hs-identifier hs-type">Fractional</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584099"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-181"></span><span>    </span><span id="local-6989586621679583712"><span class="annot"><span class="annottext">fa :: Fixed a
</span><a href="#local-6989586621679583712"><span class="hs-identifier hs-var">fa</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583711"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583711"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679583710"><span class="annot"><span class="annottext">/ :: Fixed a -&gt; Fixed a -&gt; Fixed a
</span><a href="#local-6989586621679583710"><span class="hs-operator hs-var hs-var hs-var hs-var">/</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583709"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583709"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583711"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583712"><span class="hs-identifier hs-var">fa</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583709"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>    </span><span id="local-6989586621679583706"><span class="annot"><span class="annottext">recip :: Fixed a -&gt; Fixed a
</span><a href="GHC.Real.html#recip"><span class="hs-identifier hs-var hs-var hs-var hs-var">recip</span></a></span></span><span> </span><span id="local-6989586621679583704"><span class="annot"><span class="annottext">fa :: Fixed a
</span><a href="#local-6989586621679583704"><span class="hs-identifier hs-var">fa</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583703"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583703"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583702"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583702"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583703"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-183"></span><span>        </span><span id="local-6989586621679583702"><span class="annot"><span class="annottext">res :: Integer
</span><a href="#local-6989586621679583702"><span class="hs-identifier hs-var hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583704"><span class="hs-identifier hs-var">fa</span></a></span><span>
</span><span id="line-184"></span><span>    </span><span id="local-6989586621679583694"><span class="annot"><span class="annottext">fromRational :: Rational -&gt; Fixed a
</span><a href="GHC.Real.html#fromRational"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromRational</span></a></span></span><span> </span><span id="local-6989586621679583693"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621679583693"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Fixed a) -&gt; Fixed a
forall {k} (a :: k) (f :: k -&gt; *).
HasResolution a =&gt;
(Integer -&gt; f a) -&gt; f a
</span><a href="Data.Fixed.html#withResolution"><span class="hs-identifier hs-var">withResolution</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679583692"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583692"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Integer
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#floor"><span class="hs-identifier hs-var">floor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621679583693"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Rational -&gt; Rational
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583692"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-187"></span><span id="local-6989586621679584092"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584092"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Real.html#RealFrac"><span class="hs-identifier hs-type">RealFrac</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584092"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-188"></span><span>    </span><span id="local-6989586621679583675"><span class="annot"><span class="annottext">properFraction :: forall b. Integral b =&gt; Fixed a -&gt; (b, Fixed a)
</span><a href="GHC.Real.html#properFraction"><span class="hs-identifier hs-var hs-var hs-var hs-var">properFraction</span></a></span></span><span> </span><span id="local-6989586621679583673"><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583673"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679583672"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583673"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Fixed a -&gt; Fixed a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Fixed a
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679583672"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-189"></span><span>        </span><span id="local-6989586621679583672"><span class="annot"><span class="annottext">i :: b
</span><a href="#local-6989586621679583672"><span class="hs-identifier hs-var hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; b
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#truncate"><span class="hs-identifier hs-var">truncate</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583673"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-190"></span><span>    </span><span id="local-6989586621679583663"><span class="annot"><span class="annottext">truncate :: forall b. Integral b =&gt; Fixed a -&gt; b
</span><a href="#local-6989586621679583663"><span class="hs-identifier hs-var hs-var hs-var hs-var">truncate</span></a></span></span><span> </span><span id="local-6989586621679583662"><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583662"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; b
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#truncate"><span class="hs-identifier hs-var">truncate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583662"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>    </span><span id="local-6989586621679583657"><span class="annot"><span class="annottext">round :: forall b. Integral b =&gt; Fixed a -&gt; b
</span><a href="GHC.Real.html#round"><span class="hs-identifier hs-var hs-var hs-var hs-var">round</span></a></span></span><span> </span><span id="local-6989586621679583655"><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583655"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; b
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#round"><span class="hs-identifier hs-var">round</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583655"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>    </span><span id="local-6989586621679583650"><span class="annot"><span class="annottext">ceiling :: forall b. Integral b =&gt; Fixed a -&gt; b
</span><a href="GHC.Real.html#ceiling"><span class="hs-identifier hs-var hs-var hs-var hs-var">ceiling</span></a></span></span><span> </span><span id="local-6989586621679583648"><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583648"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; b
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#ceiling"><span class="hs-identifier hs-var">ceiling</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583648"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span>    </span><span id="local-6989586621679583643"><span class="annot"><span class="annottext">floor :: forall b. Integral b =&gt; Fixed a -&gt; b
</span><a href="#local-6989586621679583643"><span class="hs-identifier hs-var hs-var hs-var hs-var">floor</span></a></span></span><span> </span><span id="local-6989586621679583642"><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583642"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; b
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#floor"><span class="hs-identifier hs-var">floor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Rational
forall a. Real a =&gt; a -&gt; Rational
</span><a href="GHC.Real.html#toRational"><span class="hs-identifier hs-var">toRational</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583642"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="annot"><a href="Data.Fixed.html#chopZeros"><span class="hs-identifier hs-type">chopZeros</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-196"></span><span id="chopZeros"><span class="annot"><span class="annottext">chopZeros :: Integer -&gt; String
</span><a href="Data.Fixed.html#chopZeros"><span class="hs-identifier hs-var hs-var">chopZeros</span></a></span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-197"></span><span class="annot"><a href="Data.Fixed.html#chopZeros"><span class="hs-identifier hs-var">chopZeros</span></a></span><span> </span><span id="local-6989586621679583640"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583640"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#mod"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583640"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; String
</span><a href="Data.Fixed.html#chopZeros"><span class="hs-identifier hs-var">chopZeros</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#div"><span class="hs-identifier hs-var">div</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583640"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">10</span></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span class="annot"><a href="Data.Fixed.html#chopZeros"><span class="hs-identifier hs-var">chopZeros</span></a></span><span> </span><span id="local-6989586621679583638"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583638"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583638"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-comment">-- only works for positive a</span><span>
</span><span id="line-201"></span><span class="annot"><a href="Data.Fixed.html#showIntegerZeros"><span class="hs-identifier hs-type">showIntegerZeros</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-202"></span><span id="showIntegerZeros"><span class="annot"><span class="annottext">showIntegerZeros :: Bool -&gt; Int -&gt; Integer -&gt; String
</span><a href="Data.Fixed.html#showIntegerZeros"><span class="hs-identifier hs-var hs-var">showIntegerZeros</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-203"></span><span class="annot"><a href="Data.Fixed.html#showIntegerZeros"><span class="hs-identifier hs-var">showIntegerZeros</span></a></span><span> </span><span id="local-6989586621679583635"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679583635"><span class="hs-identifier hs-var">chopTrailingZeros</span></a></span></span><span> </span><span id="local-6989586621679583634"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679583634"><span class="hs-identifier hs-var">digits</span></a></span></span><span> </span><span id="local-6989586621679583633"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583633"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; String
forall a. Int -&gt; a -&gt; [a]
</span><a href="GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679583634"><span class="hs-identifier hs-var">digits</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679583630"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'0'</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679583629"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-204"></span><span>    </span><span id="local-6989586621679583630"><span class="annot"><span class="annottext">s :: String
</span><a href="#local-6989586621679583630"><span class="hs-identifier hs-var hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583633"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-205"></span><span>    </span><span id="local-6989586621679583629"><span class="annot"><span class="annottext">s' :: String
</span><a href="#local-6989586621679583629"><span class="hs-identifier hs-var hs-var">s'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679583635"><span class="hs-identifier hs-var">chopTrailingZeros</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; String
</span><a href="Data.Fixed.html#chopZeros"><span class="hs-identifier hs-var">chopZeros</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583633"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679583630"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span class="annot"><a href="Data.Fixed.html#withDot"><span class="hs-identifier hs-type">withDot</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-208"></span><span id="withDot"><span class="annot"><span class="annottext">withDot :: String -&gt; String
</span><a href="Data.Fixed.html#withDot"><span class="hs-identifier hs-var hs-var">withDot</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-209"></span><span class="annot"><a href="Data.Fixed.html#withDot"><span class="hs-identifier hs-var">withDot</span></a></span><span> </span><span id="local-6989586621679583626"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679583626"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679583626"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-210"></span><span>
</span><span id="line-211"></span><span class="hs-comment">-- | First arg is whether to chop off trailing zeros</span><span>
</span><span id="line-212"></span><span id="local-6989586621679584080"><span class="annot"><a href="Data.Fixed.html#showFixed"><span class="hs-identifier hs-type">showFixed</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584080"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584080"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-213"></span><span id="showFixed"><span class="annot"><span class="annottext">showFixed :: forall {k} (a :: k). HasResolution a =&gt; Bool -&gt; Fixed a -&gt; String
</span><a href="Data.Fixed.html#showFixed"><span class="hs-identifier hs-var hs-var">showFixed</span></a></span></span><span> </span><span id="local-6989586621679583619"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679583619"><span class="hs-identifier hs-var">chopTrailingZeros</span></a></span></span><span> </span><span id="local-6989586621679583618"><span class="annot"><span class="annottext">fa :: Fixed a
</span><a href="#local-6989586621679583618"><span class="hs-identifier hs-var">fa</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583617"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583617"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583617"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Fixed a -&gt; String
forall {k} (a :: k). HasResolution a =&gt; Bool -&gt; Fixed a -&gt; String
</span><a href="Data.Fixed.html#showFixed"><span class="hs-identifier hs-var">showFixed</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679583619"><span class="hs-identifier hs-var">chopTrailingZeros</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a -&gt; Fixed a -&gt; Fixed a
forall a. a -&gt; a -&gt; a
</span><a href="GHC.Base.html#asTypeOf"><span class="hs-identifier hs-var">asTypeOf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall k (a :: k). Integer -&gt; Fixed a
</span><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-var">MkFixed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a
</span><a href="GHC.Num.html#negate"><span class="hs-identifier hs-var">negate</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583617"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583618"><span class="hs-identifier hs-var">fa</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span class="annot"><a href="Data.Fixed.html#showFixed"><span class="hs-identifier hs-var">showFixed</span></a></span><span> </span><span id="local-6989586621679583614"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679583614"><span class="hs-identifier hs-var">chopTrailingZeros</span></a></span></span><span> </span><span id="local-6989586621679583613"><span class="annot"><span class="annottext">fa :: Fixed a
</span><a href="#local-6989586621679583613"><span class="hs-identifier hs-var">fa</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#MkFixed"><span class="hs-identifier hs-type">MkFixed</span></a></span><span> </span><span id="local-6989586621679583612"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583612"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583611"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Data.Fixed.html#withDot"><span class="hs-identifier hs-var">withDot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Integer -&gt; String
</span><a href="Data.Fixed.html#showIntegerZeros"><span class="hs-identifier hs-var">showIntegerZeros</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679583614"><span class="hs-identifier hs-var">chopTrailingZeros</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679583610"><span class="hs-identifier hs-var">digits</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583609"><span class="hs-identifier hs-var">fracNum</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-215"></span><span>    </span><span id="local-6989586621679583607"><span class="annot"><span class="annottext">res :: Integer
</span><a href="#local-6989586621679583607"><span class="hs-identifier hs-var hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583613"><span class="hs-identifier hs-var">fa</span></a></span><span>
</span><span id="line-216"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679583611"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583611"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679583605"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583605"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; (Integer, Integer)
forall a. Integral a =&gt; a -&gt; a -&gt; (a, a)
</span><a href="GHC.Real.html#divMod"><span class="hs-identifier hs-var">divMod</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583612"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583607"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-217"></span><span>    </span><span class="hs-comment">-- enough digits to be unambiguous</span><span>
</span><span id="line-218"></span><span>    </span><span id="local-6989586621679583610"><span class="annot"><span class="annottext">digits :: Int
</span><a href="#local-6989586621679583610"><span class="hs-identifier hs-var hs-var">digits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Double -&gt; Int
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#ceiling"><span class="hs-identifier hs-var">ceiling</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; Double -&gt; Double
forall a. Floating a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Float.html#logBase"><span class="hs-identifier hs-var">logBase</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><span class="hs-number">10</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Double
forall a. Num a =&gt; Integer -&gt; a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583607"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-219"></span><span>    </span><span id="local-6989586621679583590"><span class="annot"><span class="annottext">maxnum :: Integer
</span><a href="#local-6989586621679583590"><span class="hs-identifier hs-var hs-var">maxnum</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Integer
forall a b. (Num a, Integral b) =&gt; a -&gt; b -&gt; a
</span><a href="GHC.Real.html#%5E"><span class="hs-operator hs-var">^</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679583610"><span class="hs-identifier hs-var">digits</span></a></span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-comment">-- read floors, so show must ceil for `read . show = id` to hold. See #9240</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621679583609"><span class="annot"><span class="annottext">fracNum :: Integer
</span><a href="#local-6989586621679583609"><span class="hs-identifier hs-var hs-var">fracNum</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="#local-6989586621679583586"><span class="hs-identifier hs-var">divCeil</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583605"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583590"><span class="hs-identifier hs-var">maxnum</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583607"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-222"></span><span>    </span><span id="local-6989586621679583586"><span class="annot"><span class="annottext">divCeil :: a -&gt; a -&gt; a
</span><a href="#local-6989586621679583586"><span class="hs-identifier hs-var hs-var">divCeil</span></a></span></span><span> </span><span id="local-6989586621679583577"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583577"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679583576"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583576"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583577"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583576"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#div"><span class="hs-operator hs-var">`div`</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679583576"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-225"></span><span id="local-6989586621679584071"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679583571"><span id="local-6989586621679583573"><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584071"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584071"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-226"></span><span>    </span><span id="local-6989586621679583563"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Fixed a -&gt; String -&gt; String
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span id="local-6989586621679583561"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679583561"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679583560"><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583560"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; (String -&gt; String) -&gt; String -&gt; String
</span><a href="GHC.Show.html#showParen"><span class="hs-identifier hs-var">showParen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679583561"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583560"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Fixed a -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((String -&gt; String) -&gt; String -&gt; String)
-&gt; (String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String -&gt; String) -&gt; String -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Fixed a -&gt; String
forall {k} (a :: k). HasResolution a =&gt; Bool -&gt; Fixed a -&gt; String
</span><a href="Data.Fixed.html#showFixed"><span class="hs-identifier hs-var">showFixed</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a
</span><a href="#local-6989586621679583560"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-comment">-- | @since 4.3.0.0</span><span>
</span><span id="line-229"></span><span id="local-6989586621679584063"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679583554"><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584063"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584063"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-230"></span><span>    </span><span id="local-6989586621679583547"><span class="annot"><span class="annottext">readPrec :: ReadPrec (Fixed a)
</span><a href="GHC.Read.html#readPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">readPrec</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Lexeme -&gt; ReadPrec (Fixed a)) -&gt; ReadPrec (Fixed a)
forall a. Num a =&gt; (Lexeme -&gt; ReadPrec a) -&gt; ReadPrec a
</span><a href="GHC.Read.html#readNumber"><span class="hs-identifier hs-var">readNumber</span></a></span><span> </span><span class="annot"><span class="annottext">Lexeme -&gt; ReadPrec (Fixed a)
forall {k} (a :: k).
HasResolution a =&gt;
Lexeme -&gt; ReadPrec (Fixed a)
</span><a href="Data.Fixed.html#convertFixed"><span class="hs-identifier hs-var">convertFixed</span></a></span><span>
</span><span id="line-231"></span><span>    </span><span id="local-6989586621679583542"><span class="annot"><span class="annottext">readListPrec :: ReadPrec [Fixed a]
</span><a href="GHC.Read.html#readListPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">readListPrec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadPrec [Fixed a]
forall a. Read a =&gt; ReadPrec [a]
</span><a href="GHC.Read.html#readListPrecDefault"><span class="hs-identifier hs-var">readListPrecDefault</span></a></span><span>
</span><span id="line-232"></span><span>    </span><span id="local-6989586621679583538"><span class="annot"><span class="annottext">readList :: ReadS [Fixed a]
</span><a href="GHC.Read.html#readList"><span class="hs-identifier hs-var hs-var hs-var hs-var">readList</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadS [Fixed a]
forall a. Read a =&gt; ReadS [a]
</span><a href="GHC.Read.html#readListDefault"><span class="hs-identifier hs-var">readListDefault</span></a></span></span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="annot"><a href="Data.Fixed.html#convertFixed"><span class="hs-identifier hs-type">convertFixed</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679584059"><span class="annot"><a href="#local-6989586621679584059"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584059"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Text.Read.Lex.html#Lexeme"><span class="hs-identifier hs-type">Lexeme</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.ParserCombinators.ReadPrec.html#ReadPrec"><span class="hs-identifier hs-type">ReadPrec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584059"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span id="convertFixed"><span class="annot"><span class="annottext">convertFixed :: forall {k} (a :: k).
HasResolution a =&gt;
Lexeme -&gt; ReadPrec (Fixed a)
</span><a href="Data.Fixed.html#convertFixed"><span class="hs-identifier hs-var hs-var">convertFixed</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Read.Lex.html#Number"><span class="hs-identifier hs-type">Number</span></a></span><span> </span><span id="local-6989586621679583524"><span class="annot"><span class="annottext">Number
</span><a href="#local-6989586621679583524"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679583523"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583523"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679583522"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583522"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Number -&gt; Maybe (Integer, Integer)
</span><a href="Text.Read.Lex.html#numberToFixed"><span class="hs-identifier hs-var">numberToFixed</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583520"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">Number
</span><a href="#local-6989586621679583524"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-237"></span><span>    </span><span class="annot"><span class="annottext">Fixed a -&gt; ReadPrec (Fixed a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583523"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Fixed a -&gt; Fixed a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Fixed a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583522"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Fixed a -&gt; Fixed a
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixed a
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Fixed a -&gt; Integer -&gt; Fixed a
forall a b. (Num a, Integral b) =&gt; a -&gt; b -&gt; a
</span><a href="GHC.Real.html#%5E"><span class="hs-operator hs-var">^</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583520"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679583518"><span class="annot"><span class="annottext">r :: Integer
</span><a href="#local-6989586621679583518"><span class="hs-identifier hs-var hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Proxy a -&gt; Integer
forall k (a :: k) (p :: k -&gt; *). HasResolution a =&gt; p a -&gt; Integer
</span><a href="Data.Fixed.html#resolution"><span class="hs-identifier hs-var">resolution</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy a
forall {k} (t :: k). Proxy t
</span><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679584059"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span>          </span><span class="hs-comment">-- round 'e' up to help make the 'read . show == id' property</span><span>
</span><span id="line-240"></span><span>          </span><span class="hs-comment">-- possible also for cases where 'resolution' is not a</span><span>
</span><span id="line-241"></span><span>          </span><span class="hs-comment">-- power-of-10, such as e.g. when 'resolution = 128'</span><span>
</span><span id="line-242"></span><span>          </span><span id="local-6989586621679583520"><span class="annot"><span class="annottext">e :: Integer
</span><a href="#local-6989586621679583520"><span class="hs-identifier hs-var hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Double -&gt; Integer
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#ceiling"><span class="hs-identifier hs-var">ceiling</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; Double -&gt; Double
forall a. Floating a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Float.html#logBase"><span class="hs-identifier hs-var">logBase</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><span class="hs-number">10</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Double
forall a. Num a =&gt; Integer -&gt; a
</span><a href="GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679583518"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span class="annot"><a href="Data.Fixed.html#convertFixed"><span class="hs-identifier hs-var">convertFixed</span></a></span><span> </span><span class="annot"><span class="annottext">Lexeme
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadPrec (Fixed a)
forall a. ReadPrec a
</span><a href="Text.ParserCombinators.ReadPrec.html#pfail"><span class="hs-identifier hs-var">pfail</span></a></span><span>
</span><span id="line-244"></span><span>
</span><span id="line-245"></span><span class="hs-keyword">data</span><span> </span><span id="E0"><span class="annot"><a href="Data.Fixed.html#E0"><span class="hs-identifier hs-var">E0</span></a></span></span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-248"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E0"><span class="hs-identifier hs-type">E0</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-249"></span><span>    </span><span id="local-6989586621679583509"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E0 -&gt; Integer
</span><a href="#local-6989586621679583509"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E0
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-250"></span><span class="hs-comment">-- | resolution of 1, this works the same as Integer</span><span>
</span><span id="line-251"></span><span class="hs-keyword">type</span><span> </span><span id="Uni"><span class="annot"><a href="Data.Fixed.html#Uni"><span class="hs-identifier hs-var">Uni</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E0"><span class="hs-identifier hs-type">E0</span></a></span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span class="hs-keyword">data</span><span> </span><span id="E1"><span class="annot"><a href="Data.Fixed.html#E1"><span class="hs-identifier hs-var">E1</span></a></span></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-256"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E1"><span class="hs-identifier hs-type">E1</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-257"></span><span>    </span><span id="local-6989586621679583506"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E1 -&gt; Integer
</span><a href="#local-6989586621679583506"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E1
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">10</span></span><span>
</span><span id="line-258"></span><span class="hs-comment">-- | resolution of 10^-1 = .1</span><span>
</span><span id="line-259"></span><span class="hs-keyword">type</span><span> </span><span id="Deci"><span class="annot"><a href="Data.Fixed.html#Deci"><span class="hs-identifier hs-var">Deci</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E1"><span class="hs-identifier hs-type">E1</span></a></span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="hs-keyword">data</span><span> </span><span id="E2"><span class="annot"><a href="Data.Fixed.html#E2"><span class="hs-identifier hs-var">E2</span></a></span></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-264"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E2"><span class="hs-identifier hs-type">E2</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-265"></span><span>    </span><span id="local-6989586621679583503"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E2 -&gt; Integer
</span><a href="#local-6989586621679583503"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E2
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">100</span></span><span>
</span><span id="line-266"></span><span class="hs-comment">-- | resolution of 10^-2 = .01, useful for many monetary currencies</span><span>
</span><span id="line-267"></span><span class="hs-keyword">type</span><span> </span><span id="Centi"><span class="annot"><a href="Data.Fixed.html#Centi"><span class="hs-identifier hs-var">Centi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E2"><span class="hs-identifier hs-type">E2</span></a></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="hs-keyword">data</span><span> </span><span id="E3"><span class="annot"><a href="Data.Fixed.html#E3"><span class="hs-identifier hs-var">E3</span></a></span></span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-272"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E3"><span class="hs-identifier hs-type">E3</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-273"></span><span>    </span><span id="local-6989586621679583500"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E3 -&gt; Integer
</span><a href="#local-6989586621679583500"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E3
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1000</span></span><span>
</span><span id="line-274"></span><span class="hs-comment">-- | resolution of 10^-3 = .001</span><span>
</span><span id="line-275"></span><span class="hs-keyword">type</span><span> </span><span id="Milli"><span class="annot"><a href="Data.Fixed.html#Milli"><span class="hs-identifier hs-var">Milli</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E3"><span class="hs-identifier hs-type">E3</span></a></span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="hs-keyword">data</span><span> </span><span id="E6"><span class="annot"><a href="Data.Fixed.html#E6"><span class="hs-identifier hs-var">E6</span></a></span></span><span>
</span><span id="line-278"></span><span>
</span><span id="line-279"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-280"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E6"><span class="hs-identifier hs-type">E6</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-281"></span><span>    </span><span id="local-6989586621679583497"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E6 -&gt; Integer
</span><a href="#local-6989586621679583497"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E6
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1000000</span></span><span>
</span><span id="line-282"></span><span class="hs-comment">-- | resolution of 10^-6 = .000001</span><span>
</span><span id="line-283"></span><span class="hs-keyword">type</span><span> </span><span id="Micro"><span class="annot"><a href="Data.Fixed.html#Micro"><span class="hs-identifier hs-var">Micro</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E6"><span class="hs-identifier hs-type">E6</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-keyword">data</span><span> </span><span id="E9"><span class="annot"><a href="Data.Fixed.html#E9"><span class="hs-identifier hs-var">E9</span></a></span></span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-288"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E9"><span class="hs-identifier hs-type">E9</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-289"></span><span>    </span><span id="local-6989586621679583494"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E9 -&gt; Integer
</span><a href="#local-6989586621679583494"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E9
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1000000000</span></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- | resolution of 10^-9 = .000000001</span><span>
</span><span id="line-291"></span><span class="hs-keyword">type</span><span> </span><span id="Nano"><span class="annot"><a href="Data.Fixed.html#Nano"><span class="hs-identifier hs-var">Nano</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E9"><span class="hs-identifier hs-type">E9</span></a></span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-keyword">data</span><span> </span><span id="E12"><span class="annot"><a href="Data.Fixed.html#E12"><span class="hs-identifier hs-var">E12</span></a></span></span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-296"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Fixed.html#HasResolution"><span class="hs-identifier hs-type">HasResolution</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E12"><span class="hs-identifier hs-type">E12</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-297"></span><span>    </span><span id="local-6989586621679583491"><span class="annot"><span class="annottext">resolution :: forall (p :: * -&gt; *). p E12 -&gt; Integer
</span><a href="#local-6989586621679583491"><span class="hs-identifier hs-var hs-var hs-var hs-var">resolution</span></a></span></span><span> </span><span class="annot"><span class="annottext">p E12
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1000000000000</span></span><span>
</span><span id="line-298"></span><span class="hs-comment">-- | resolution of 10^-12 = .000000000001</span><span>
</span><span id="line-299"></span><span class="hs-keyword">type</span><span> </span><span id="Pico"><span class="annot"><a href="Data.Fixed.html#Pico"><span class="hs-identifier hs-var">Pico</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Data.Fixed.html#Fixed"><span class="hs-identifier hs-type">Fixed</span></a></span><span> </span><span class="annot"><a href="Data.Fixed.html#E12"><span class="hs-identifier hs-type">E12</span></a></span><span>
</span><span id="line-300"></span></pre></body></html>